/////////////////////////////////////////////////////////////////
//	File Name	:	"CGame.h"
//
//	Author Name	:	Adam Marculaitis (AM)
//
//	Purpose		:	To encapsulate all game related code.
/////////////////////////////////////////////////////////////////

#pragma once // MSVS specific (told it works on GCC)

//	SGD singletons
#include "SGD Wrappers/CSGD_Direct3D.h"
#include "SGD Wrappers/CSGD_TextureManager.h"
#include "SGD Wrappers/CSGD_DirectSound.h"
#include "SGD Wrappers/CSGD_WaveManager.h"
#include "SGD Wrappers/CSGD_DirectInput.h"
#include "Messaging/CSGD_MessageSystem.h"
#include "Messaging/CSGD_EventSystem.h"
#include <string>
using std::string;


class CGame
{
private:


	//	SGD singleton pointers:
	CSGD_Direct3D*						m_pD3D;
	CSGD_TextureManager*				m_pTM;
	CSGD_DirectSound*					m_pDS;
	CSGD_WaveManager*					m_pWM;
	CSGD_DirectInput*					m_pDI;

	int	m_nWINDOW_WIDTH;
	int m_nWINDOW_HEIGHT;
	bool m_bIS_WINDOWED;

	//vector<IGameState*> m_pGS;

	float m_fElapsedTime;
	float m_fPreviousTime;


	//	Proper singleton:

	//	Constructor
	CGame(void);

	//	Trilogy of Evil:
	//	Copy Constructor
	CGame(const CGame&);

	//	Assignment operator
	CGame& operator=(const CGame&);

	//	Destructor
	~CGame(void);

	//	3 steps a game goes through
	//	during execution:
	bool Input(void);
	void Update(void);
	void Render(void);

public:
	//	3 steps a game goes through in its lifetime
	//	1.	Initialization
	void Initialize(HWND hWnd, HINSTANCE hInstance,
		int nScreenWidth, int nScreenHeight, bool bIsWindowed);

	//	2.	Execution
	bool Main(void);

	//	3.	Clean Up
	void Shutdown(void);

	//void ChangeState(IGameState *pGS);

	//void Died() {m_nLives[m_nPlayerTurn-1]--;}
	//void ResetPlayers();
	//void PushState(IGameState* pState);
	//void PopState();
	//void ClearAllStates();
	//bool IsHighscore(int nScore) { if(nScore > m_highscores[9].m_nScore){return true;}else{return false;}}
	//bool LoadHighScores();
	//bool LoadSounds();
	//bool SaveHighScores();
	//bool SaveSounds();
	//void SortHighScores();

	//////////////////////////////////////////////////////////////////////////////////////////////////////
	//  Function: Accessors
	//
	//  Purpose : Returns the specified type.
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	static CGame* GetInstance(void);
	int GetScreenWidth();
	int GetScreenHeight();
	bool GetWindowMode();
	/*int GetScore() {return m_nScores[m_nPlayerTurn-1];}
	int GetMaxPlayers() {return m_nMaxPlayers;}
	int GetPlayerTurn() {return m_nPlayerTurn;}
	int GetPlayerLives() { return m_nLives[m_nPlayerTurn-1];}
	int GetPlayerDamage() { return m_nDamage[m_nPlayerTurn-1];}
	int GetLevel() { return m_nLevel[m_nPlayerTurn-1];}
	int GetSoundFX() {return m_nSoundFX;}
	int GetSoundBGM() {return m_nSoundBGM;}
	Highscore* GetHighscore() {return m_highscores;}*/

	///////////////////////////////////////////////////////////////////////////////////////////////////////
	// Function: Modifiers
	//
	//  Purpose: Modifies the specified type.
	////////////////////////////////////////////////////////////////////////////////////////////////////////
	void SetScreenMode(int nScreenWidth, int nScreenHeight, bool bIsWindowed);
	void SetScreenResolution(int nScreenWidth, int nScreenHeight);
	void SetScreenWidth(int nScreenWidth);
	void SetScreenHeight(int nScreenHeight);
	void SetWindowMode(bool bIsWindowed);
	/*void SetScore(int nScore) {m_nScores[m_nPlayerTurn-1] = nScore;}
	void SetMaxPlayers(int nPlayers) {m_nMaxPlayers = nPlayers;}
	void SetPlayerTurn(int nTurn) {m_nPlayerTurn = nTurn;}
	void SetPlayerDamage(int nDamage) {m_nDamage[m_nPlayerTurn-1] = nDamage;}
	void SetLevel(int nLevel) {m_nLevel[m_nPlayerTurn-1] = nLevel;}
	void SetLives(int nLives) {m_nLives[m_nPlayerTurn-1] = nLives;}
	void SetSoundFX(int nSoundFX) {m_nSoundFX = nSoundFX;}
	void SetSoundBGM(int nSoundBGM) {m_nSoundBGM = nSoundBGM;}
	void SetLastHighscore(int nScore, char chName[4]);*/


	//static void MessageProc(CBaseMessage* pMsg);
};